<template>
  <div class="waiting-info">
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">列表区域设置</el-divider>
      </div>
      <el-form-item label="内容高度">
        <el-input-number
          v-model="optionsInfo['areaHeight']"
          :min="40"
          size="small"
          class="hide-spin-button"
        />
      </el-form-item>

<!--      <el-form-item label="内边距顶部">-->
<!--        <el-input-number-->
<!--          v-model="optionsInfo['paddingTop']"-->
<!--          :min="1"-->
<!--          size="small"-->
<!--          class="hide-spin-button"-->
<!--        />-->
<!--      </el-form-item>-->

<!--      <el-form-item label="内边距底部">-->
<!--        <el-input-number-->
<!--          v-model="optionsInfo['paddingBottom']"-->
<!--          :min="1"-->
<!--          size="small"-->
<!--          class="hide-spin-button"-->
<!--        />-->
<!--      </el-form-item>-->

      <!--      {{optionsInfo}}-->
      <template v-if="optionsInfo['currentShown']">
        <el-form-item label="当前检查文案">
          <el-input
            v-model="optionsInfo['currentPaperwork']"
            size="small"
            class="hide-spin-button"
          />
        </el-form-item>
        <el-form-item label="当前检查文字大小">
          <el-input-number
            v-model="optionsInfo['currentFontSize']"
            size="small"
            class="hide-spin-button"
          />
        </el-form-item>
      </template>

      <template v-if="optionsInfo['bgColorShown']">
        <div class="list-title-setting">
          <div class="title-info">
            <el-divider content-position="left">列表名设置</el-divider>
          </div>

          <el-form-item label="背景颜色">
            <el-color-picker
              size="small"
              show-alpha
              :predefine="predefineColors"
              v-model="optionsInfo['headerBackgroundColor']"/>
          </el-form-item>

          <el-form-item label="字体颜色">
            <el-color-picker
              size="small"
              show-alpha
              :predefine="predefineColors"
              v-model="optionsInfo['headerFontColor']"/>
          </el-form-item>
        </div>
      </template>
<!--      <template v-if="optionsInfo['curPatientShown']">-->
<!--        <div class="wait-visit-setting">-->
<!--          <div class="title-info">-->
<!--            <el-divider content-position="left">当前检查设置</el-divider>-->
<!--          </div>-->
<!--          <el-form-item label="开启滚动">-->
<!--            <el-switch v-model="optionsInfo.openScroll1"/>-->
<!--          </el-form-item>-->

<!--          <el-form-item label="开启滚动数量">-->
<!--            <el-input-number-->
<!--              :min="0"-->
<!--              size="small"-->
<!--              class="hide-spin-button"-->
<!--              v-model="optionsInfo.waitingNumber1"-->
<!--            />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="滚动速度">-->
<!--            <el-input-number-->
<!--              :min="1"-->
<!--              :max="5"-->
<!--              size="small"-->
<!--              class="hide-spin-button"-->
<!--              :disabled="!(optionsInfo.openScroll)"-->
<!--              v-model="optionsInfo.waitingVisitStep1"-->
<!--            />-->
<!--          </el-form-item>-->
<!--        </div>-->
<!--      </template>-->

<!--      <template v-if="optionsInfo['waitPatientShown']">-->
<!--        <div class="wait-visit-setting">-->
<!--          <div class="title-info">-->
<!--            <el-divider content-position="left">等待检查设置</el-divider>-->
<!--          </div>-->
<!--          <el-form-item label="开启滚动">-->
<!--            <el-switch v-model="optionsInfo.openScroll"/>-->
<!--          </el-form-item>-->

<!--          <el-form-item label="开启滚动数量">-->
<!--            <el-input-number-->
<!--              :min="0"-->
<!--              size="small"-->
<!--              class="hide-spin-button"-->
<!--              v-model="optionsInfo.waitingNumber"-->
<!--            />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="滚动速度">-->
<!--            <el-input-number-->
<!--              :min="1"-->
<!--              :max="5"-->
<!--              size="small"-->
<!--              class="hide-spin-button"-->
<!--              :disabled="!(optionsInfo.openScroll)"-->
<!--              v-model="optionsInfo.waitingVisitStep"-->
<!--            />-->
<!--          </el-form-item>-->
<!--        </div>-->
<!--      </template>-->

      <template v-if="optionsInfo['deptConfig']">
        <el-form-item label="顶部属性设置" class="column-area">
          <el-radio-group v-model="optionsInfo['titleType']">
            <el-radio  v-for="(item) in titleTypeOptions" :label="item.value" :key="item.value">{{item.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
      </template>
    </div>
  </div>
</template>

<script>
import Template from "@sc/template/index.vue";
import * as types from "@c/public/form-designer/devType/datas-types";

export default {
  name: "sceneWaitingCurrent2-editor",

  componentName: "sceneWaitingCurrent2-editor",

  components: {Template},

  mixins: [],

  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },

  inject: ['serverFieldList', 'getDesignerConfig'],

  data() {
    return {
      optionsInfo: Object(),
      predefineColors: types['predefineColors'],
      titleTypeOptions: [
        {
          value: 'treatmentRoomName',
          label: '诊室'
        },
        {
          value: 'registerObjNames',
          label: '号别'
        },
        {
          value: 'deptName',
          label: '科室'
        },
        {

          value: 'treatmentRoomName-registerObjNames',
          label: '诊室-号别'
        }
      ],
    }
  },

  computed: {},

  methods: {},

  watch: {
    // 组件的所有信息
    optionModel: {
      handler: function (val) {
        this.optionsInfo = val[val.config];
      },
      deep: true,
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
.column-area{
  display: flex;
  flex-direction: column;
  :deep(.el-form-item__label){
    width: 100% !important;
    margin-bottom: 10px;
  }
  :deep(.el-form-item__content){
    width: 100%;
    margin-left: 0 !important;
    .el-radio-group{
      width: 100%;
      display: flex;
      flex-direction: column;
      .el-radio{
        margin-bottom: 10px;
      }
    }
  }

}
</style>

